function drawLine(x1,y1,x2,y2){
    canvas.moveTo(x1,y1);
    canvas.lineTo(x2,y2);
    canvas.stroke();
}
function distance(a,b){//计算距离
    return Math.sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
function sitaGiver(rx,ry){//专门用来算角度
    let sita;//角度
    if(rx ==0) {//tan90度一生之敌
        sita = ry>0?Math.PI/2:-Math.PI/2;
    }else sita = Math.atan(ry/rx);
    if(sita == 0 && rx<0) sita = Math.PI;
    //sita 修正，因为tan函数的周期性只有一个PI
    if((rx<0&&ry<0)||(rx<0&&ry>0)) sita+=Math.PI;
    return sita;
}
var canvas = $("canvas")[0].getContext("2d");
var structure={
    floors:4,//层数
    floorPoints:[{x:0,y:0,id:0,width:4},{x:100,y:0,id:1,width:4}],//楼梯节点
    floorConnections:[{from:0,to:1,width:5,classCounts:4,leftW:0,rightW:0}],
    floorHeight:40,//楼层高度，包括长轴
    population:52,
    classRoomMargin:3.5,
    floor:5,
    classWidth:10
}
function initByStructure(){
    //生成第一层
    for(let i in floorConnections){
        let fi = floorConnections[i];
        for(let ii=1;ii<=floor;ii++){
            HallWay.newHallWay(fi.width,distance(floorPoints[fi.from],floorPoints[fi.to]),ii,
            floorConnections.from,floorConnections.to,testNewClassRoom(classCounts,population),
            classRoomMargin,fi.leftW,fi.rightW);
        }
    }
    for(let i in floorPoints){
        let fi = floorPoints[i];
        for(let ii=0;ii<floor;ii++){
            Hole.newHole(fi.width,floorHeight,ii,fi.id);
        }
    }
}
function run(){
    
}
function disPlayOn(){
    let offSetX = 30;
    let offSetY = 30;
    let ha = HallWay.hallWay[HallWay.hallWay.length-1];
    for(let i in ha){
        
    }
}
var doubleMax = Math.pow(2,51);